Skip to content

Add feature to disable component - #103

Merged
bajtos merged 1 commit into
strongloop:masterfrom
PradnyaBaviskar:lb-explorer-issue-51
Mar 10, 2015
Merged

bajtos merged 1 commit into
strongloop:masterfrom
PradnyaBaviskar:lb-explorer-issue-51

Conversation

@PradnyaBaviskar

Copy link
Copy Markdown
Contributor

In reference to strongloop/loopback-component-explorer#51, added implementation to disable components through component-config.json

@bajtos, please review.

Comment thread lib/executor.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please filter out undefined records inside the compiler.

A possible implementation, sorry for giving you a wrong one initially:

return Object.keys(...)
  .filter(..check config is truthy..)
  .map(..original map function..)

@bajtos

bajtos commented Mar 5, 2015

Copy link
Copy Markdown
Member

One comment, the rest looks good.

@PradnyaBaviskar

Copy link
Copy Markdown
Contributor Author

Made following changes

  1. Filtered out undefined components from compiler itself.
  2. Modified the test case to verify that disabled component is not loaded

@bajtos , can you please review?

Comment thread lib/compiler.js

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you using tab characters here? Please ensure you use only spaces for indentation (you may need to change the settings in your editor).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've used space character here for indentation. I also cross-verified the editor settings. And it is set to use "spaces" only for indentation. Although not sure, why does it highlight here in green!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it's GitHub's way of showing that the line differs in whitespace only. Don't worry about that then.

@PradnyaBaviskar

Copy link
Copy Markdown
Contributor Author

Modified the test case to use appdir.resolve('components', 'test-componen', 'index.js'), for verifying that disabled components are not loaded.

@bajtos - can you please review?

Comment thread test/executor.test.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: it's best to keep the chain of chai assertions on a single line. Also when a statement continues on a next line, the next lines should be indented by two spaces.

// either
expect(Object.keys(require.cache))
  .to.include(appdir.resolve('components/test-component/index.js'));

// or 
expect(Object.keys(require.cache)).to.include(
  appdir.resolve('components/test-component/index.js'));

The same comment applies to the test below.

@bajtos

bajtos commented Mar 10, 2015

Copy link
Copy Markdown
Member

Also please sign the CLA for this project here: https://cla.strongloop.com/agreements/strongloop/loopback-boot (the page is linked from "Details" in the list of failing checks too).

@PradnyaBaviskar

Copy link
Copy Markdown
Contributor Author

@bajtos,
Made suggested changes. Can you review?

@bajtos

bajtos commented Mar 10, 2015

Copy link
Copy Markdown
Member

@slnode test please

bajtos added a commit that referenced this pull request Mar 10, 2015
@bajtos
bajtos merged commit df81d54 into strongloop:master Mar 10, 2015
@bajtos

bajtos commented Mar 10, 2015

Copy link
Copy Markdown
Member

Landed, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants